package com.have.blog.xo.service.admin.impl;

import com.have.blog.model.mapper.TCommentMapper;
import com.have.blog.model.models.TCommentExample;
import com.have.blog.xo.service.admin.AdminCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@SuppressWarnings("all")
public class AdminCommentServiceImpl implements AdminCommentService {
    @Autowired
    private TCommentMapper commentMapper;

    @Override
    public Long getCommentCount(int status) {
        TCommentExample example = new TCommentExample();
        TCommentExample.Criteria criteria = example.createCriteria();
        criteria.andStatusEqualTo(status);
        Long count = commentMapper.countByExample(example);
        return count;
    }
}
